Added docs to gtk_widget_set_parent_window.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 23 Dec 2010 17:09:41 +0000 (02:09 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 6 Jan 2011 05:39:40 +0000 (14:39 +0900)
Also stop setting the resize mode of the window.

gtk/gtkwidget.c

index cd40ab8eafd8ca9769ac2eed73f69bc404d2714f..9aa08658b251a4af82a4f523165f7fb4556c4235 100644 (file)
@@ -9069,6 +9069,16 @@ gtk_widget_render_icon (GtkWidget      *widget,
  * @parent_window: the new parent window.
  *
  * Sets a non default parent window for @widget.
+ *
+ * For GtkWindow classes, setting a @parent_window effects whether 
+ * the window is a toplevel window or can be embedded into other
+ * widgets.
+ *
+ * <note><para>
+ * For GtkWindow classes, this needs to be called before the
+ * window is realized.
+ * </para></note>
+ * 
  **/
 void
 gtk_widget_set_parent_window   (GtkWidget           *widget,
@@ -9094,11 +9104,8 @@ gtk_widget_set_parent_window   (GtkWidget           *widget,
        * this is the primary entry point to allow toplevels to be
        * embeddable.
        */
-      if (GTK_IS_WINDOW (widget))
-       {
-         _gtk_window_set_is_toplevel (GTK_WINDOW (widget), FALSE);
-         gtk_container_set_resize_mode (GTK_CONTAINER (widget), GTK_RESIZE_PARENT);
-       }
+      if (GTK_IS_WINDOW (widget) && !GTK_IS_PLUG (widget))
+       _gtk_window_set_is_toplevel (GTK_WINDOW (widget), parent_window == NULL);
     }
 }